package pl.wr.aspect.performance.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

/**
 * @author wieslaw.rodak
 *
 */
public abstract class PerformanceHelper {

	/**
	 * @param collection
	 *            - The collection of statistics.
	 * @return sorted collection.
	 */
	public static ArrayList<InvokeStatistics> sortDescendingByTime(final Collection<InvokeStatistics> collection) {
		ArrayList<InvokeStatistics> list = new ArrayList<InvokeStatistics>(collection);
		Collections.sort(list);
		Collections.reverse(list);
		return list;
	}

}
